package com.aaa.sso.feign.factory;

import com.aaa.common.entity.User;
import com.aaa.sso.feign.UserFeign;
import com.aaa.common.vo.Result;
import feign.hystrix.FallbackFactory;

/**
 * @program: aaa-hospital-parent
 * @description:
 * @author: 闫克起
 * @create: 2024-05-20 17:06
 **/
public class UserFeignFactory implements FallbackFactory<UserFeign> {
    @Override
    public UserFeign create(Throwable throwable) {
        return new UserFeign() {
            @Override
            public Result<User> selectByName(String name) {
                return new Result<User>(5000,throwable.getMessage(),null);
            }
        };
    }
}
